package com.xuyuanjia.web.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.xuyuanjia.web.entity.Subject2;
import com.xuyuanjia.web.mapper.SubjectMapper;
import com.xuyuanjia.web.service.SubjectService;
import com.xuyuanjia.web.service.support.BaseServiceImpl;
import com.xuyuanjia.web.tool.entity.TreeNode;

@Service
public class SubjectServiceImp extends BaseServiceImpl<SubjectMapper, Subject2> implements SubjectService {

	public String getZTreeToSubject() throws Exception {
		List<TreeNode> treeNodeList =  baseMapper.selectAllSubjectForZTree();
		String treeNodeListStr = JSON.toJSONString(treeNodeList);
		System.out.println(treeNodeListStr);
		return treeNodeListStr;
	}

}
